POV-Ray : Newsgroups : povray.newusers : Connecting two objects after transformation operations... : Connecting two objects after transformation operations... Server Time
28 Jul 2024 18:26:44 EDT (-0400)
  Connecting two objects after transformation operations...  
From: this is me
Date: 13 Feb 2008 06:00:00
Message: <web.47b2cc652e14cb95988f09540@news.povray.org>
Hello,

Let's say I do the following, so what I end up with is two 4-sided CSG objects
somewhere in space.  Now, using cylinders like the ones below, I'd like to
connect the 4 corners of the first CSG object to the 4 corners of the second,
but I can't figure out how to do it.  Any thoughts?



#declare Smooth = finish {specular 0.3 roughness 0.05}
#declare BondWidth = 0.1;
#declare atoms = rgb < 0, 0, 0.5 >;
#declare bonds = rgb < 0.3, 0.3, 0.3 >;

#declare C =
  sphere {
    <0.0, 0.0, 0.0>, 0.4
    texture {
      pigment {colour atoms}
      finish  {Smooth}
    }
  }

#declare A1  = < 0, 0, 0 >;
#declare A2  = < 1, 0, 0 >;
#declare A3  = < 1 ,1, 0 >;
#declare A4  = < 0, 1, 0 >;

//CSG object 1
union {
  object {
    C
    translate A1
  }
  object {
    C
    translate A2
  }
  object {
    C
    translate A3
  }
  object {
    C
    translate A4
  }
  cylinder {
    A1,
    A2,
    BondWidth
  pigment {colour bonds}
  finish  {Smooth}
}
  cylinder {
    A2,
    A3,
    BondWidth
  pigment {colour bonds}
  finish  {Smooth}
}
  cylinder {
    A3,
    A4,
    BondWidth
  pigment {colour bonds}
  finish  {Smooth}
}
  cylinder {
    A4,
    A1,
    BondWidth
  pigment {colour bonds}
  finish  {Smooth}
}
rotate SOME_ROTATE_VECTOR
translate SOME_TRANSLATE_VECTOR
}

//CSG object 2
union {
  object {
    C
    translate A1
  }
  object {
    C
    translate A2
  }
  object {
    C
    translate A3
  }
  object {
    C
    translate A4
  }
  cylinder {
    A1,
    A2,
    BondWidth
  pigment {colour bonds}
  finish  {Smooth}
}
  cylinder {
    A2,
    A3,
    BondWidth
  pigment {colour bonds}
  finish  {Smooth}
}
  cylinder {
    A3,
    A4,
    BondWidth
  pigment {colour bonds}
  finish  {Smooth}
}
  cylinder {
    A4,
    A1,
    BondWidth
  pigment {colour bonds}
  finish  {Smooth}
}
rotate SOME_OTHER_ROTATE_VECTOR
translate SOME_OTHER_TRANSLATE_VECTOR
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.